<template>
  <div class="dashboard-container">
    <div class="grid-container">
      <!-- 第一行 -->
      <div class="grid-item chart-item">
        <chart1/>
      </div>
      <div class="grid-item chart-item">
        <chart3/> 
      </div>
      <!-- 第二行 -->
      <div class="grid-item table-item">
        <table1/>
      </div>
      <div class="grid-item chart-item">
        <chart2/>
      </div>
    </div>
  </div>
</template>

<script setup>
import chart1 from './component/chart1.vue'
import chart2 from './component/chart2.vue'
import chart3 from './component/chart3.vue'
import table1 from './component/table1.vue'
</script>

<style scoped>
.dashboard-container {
  width: 100%;
  height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  overflow: auto;
}

.grid-container {
  display: grid;
  grid-template-columns: minmax(300px, 2fr) minmax(400px, 3fr);
  grid-template-rows: minmax(300px, 2fr) minmax(400px, 3fr);
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  height: calc(100vh - 40px);
}

.grid-item {
  border-radius: 12px;
  background: white;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: relative;
}

.chart-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
}

.table-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: white;
}

.grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 12px 12px 0 0;
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.05);
}

.grid-item > * {
  width: 100%;
  height: 100%;
  padding: 15px;
  box-sizing: border-box;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .grid-container {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    height: auto;
  }
  
  .dashboard-container {
    height: auto;
    min-height: 100vh;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid-item:nth-child(1) { animation: fadeIn 0.6s ease-out; }
.grid-item:nth-child(2) { animation: fadeIn 0.6s ease-out 0.1s forwards; }
.grid-item:nth-child(3) { animation: fadeIn 0.6s ease-out 0.2s forwards; }
.grid-item:nth-child(4) { animation: fadeIn 0.6s ease-out 0.3s forwards; }
</style>